﻿using System;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using AIniciacao.Lib.GameUtils;
using AIniciacao.Lib.Resources;
using AIniciacao.Lib.Screens;

namespace AIniciacao.MenuScreens
{


    class HelpScreen : MenuScreen
    {
        #region Fields
        ContentManager content;
        Texture2D background;
        #endregion
        #region Initialization
        /// <summary>
        /// Constructor.
        /// </summary>
        public HelpScreen()
            : base(AIniciacaoResourceManager.getProperty("label_help"))
        {
            MenuEntry backMenuEntry = new MenuEntry(AIniciacaoResourceManager.getProperty("label_back"));
            backMenuEntry.Selected += OnCancel;
            MenuEntries.Add(backMenuEntry);
        }
		
        #endregion

        #region Load Content

        public override void LoadContent()
        {
            if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content");
            background = content.Load<Texture2D>(GamePathObjects.AIniciacaoMenuBackgroundOptionsPath);
            CenterTitle();
        }

        #endregion
        #region Drawing

        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
            Rectangle fullscreen = new Rectangle(0, 0, viewport.Width, viewport.Height);
            byte fade = TransitionAlpha;

            Color transitionColor = new Color(fade, fade, fade);

            spriteBatch.Begin(SpriteBlendMode.AlphaBlend);

            spriteBatch.Draw(background, fullscreen, transitionColor);

            spriteBatch.End();

            base.Draw(gameTime);
        }

        #endregion
    }

}
